<?php
/**
 * Minhlog 页面导航视图助手
 *
 * LICENSE
 *
 * This source file is subject to the new BSD license that is bundled
 * with this package in the file LICENSE.txt.
 *
 * @category   View_Helper
 * @package    Minh_View_Helper
 * @copyright  Copyright (c) 2009-2010 Minh.Shu Minh.Shu@gmail.com
 * @license    New BSD License
 * @author     Minh.Shu
 * @version    $Id: PageSideBar.php 32 2010-03-30 12:40:08Z minh.shu $
 * @uses        Zend_View_Helper
 */

class Minh_View_Helper_PageSideBar extends Minh_View_Helper_SideBarAbstract
{
    public function pageSideBar ()
    {
        $cacheId = md5('pageSideBar');
        if (! ($pageSideBarCache = $this->cache->load($cacheId))) {
            $pageSideBar = array();
            $pageModel = new Domain_Model_Page();
            $pageSideBar = $pageModel->getAllPage();
            if(null === $pageSideBar){
                $pageSideBar = array();
            } else {
                $this->cache->save($pageSideBar, $cacheId);
            }
        } else {
            $pageSideBar = $pageSideBarCache;
        }
        return $pageSideBar;
    }
}